package com.xueshishasha.oa.service.impl;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.xueshishasha.oa.model.LogBook;
import com.xueshishasha.oa.service.DataService;

public class LogBookServiceImpl implements
		com.xueshishasha.oa.service.LogBookService {
	
	private final Logger logger = LoggerFactory.getLogger(LogBookServiceImpl.class);

	private DataService<LogBook> dataService ;

	

	
	@Override
	public LogBook getInfo(String id) {
		return this.getModelById(id);
	}


	@Override
	public void updateInfo(LogBook logBook) {
		this.update(logBook);
	}
	
	@Override
	public Serializable save(LogBook logBook){
		return dataService.save(logBook);
		
	}

	@Override
	public void delete(LogBook logBook) {
		dataService.delete(logBook);

	}

	@Override
	public List<LogBook> getAll() {
		String sql = "from LogBook";
		return dataService.getModels(sql,null);
	}

	@Override
	public LogBook getModelById(Serializable id) {
		return dataService.getModelById(LogBook.class, id);
	}

	@Override
	public List<LogBook> getModels(String hql, Object[] parameters) {
		return dataService.getModels(hql,parameters);
	}

	@Override
	public void saveOrUpdate(LogBook logBook) {
		dataService.saveOrUpdate(logBook);
	}

	@Override
	public void saveOrUpdateAll(Collection<LogBook> collection) {
		dataService.saveOrUpdateAll(collection);
	}

	@Override
	public void update(LogBook logBook) {
		dataService.update(logBook);
	}
	
	@Override
	public List<LogBook> getByCriteria(DetachedCriteria dc) {
		return dataService.getByCriteria(dc);
	}

	public DataService<LogBook> getDataService() {
		return dataService;
	}

	public void setDataService(DataService<LogBook> dataService) {
		this.dataService = dataService;
	}

	
}
